import Vue from 'vue'
import App from './App.vue'
import axios from "axios"
import router from "./router";
import qs from "qs"

Vue.config.productionTip = false
//待修改
axios.defaults.baseURL = 'http://localhost:8080'
Vue.prototype.$axios = axios
Vue.prototype.$qs = qs

// 使用了axios所有的请求都会走该拦截器
axios.interceptors.request.use(config => {
  let url = config.url
  if(url != '/login') {
    config.headers = {
      Authorization:localStorage.getItem('token')
    }
  }
  return config
})

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
